package string;

public class StringBuilderDemo {
    public static void main(String[] args) {
        String str = "好好学习Java";
        StringBuilder s1 = new StringBuilder(str);

        s1.append("，为了找个好工作");
        System.out.println(s1);

        s1.replace(9,16,"改变世界");
        System.out.println(s1);

        s1.delete(0,8);
        System.out.println(s1);

        s1.insert(0,"活着");
        System.out.println(s1);

        s1.reverse();
        System.out.println(s1);



        /*StringBuilder s1 = new StringBuilder();
        StringBuilder s2 = new StringBuilder("asd");

        String a = "aaa";
        StringBuilder s3 = new StringBuilder(a);
        String aa = s3.toString();
         */
    }
}
